﻿@{
	PageData["Title"] = "Products";

	var db = Database.Open("bakery");
}

@QuickEdit.GetContentHtml("productspage")
<div class="products group">
	@foreach (var p in db.Query("SELECT * FROM PRODUCTS")) {
		<div class="product">
			<h3>@p.Name</h3>
			<img src="@Href("~/Images/" + p.ImageName)" alt="@p.Name"/>
			<p>@p.Description</p>
			<ul class="group">
				<li class="price">$@string.Format("{0:f}", p.Price)</li>
				<li class="order">
					<form action="@Href("~/Order")" method="post">
						<input type="hidden" name="ProductId" value="@p.Id"/>
						<input type="submit" value="Order Now"/>
					</form>
				</li>
			<ul>
		</div>
	}    
</div>